#ifndef MethodBrowser_First
#define MethodBrowser_First
#ifdef __GNUG__
#pragma interface
#endif

#include "Dialog.h"
#include "CollView.h"
#include "TextItem.h"

class RegularExp;
class SeqCollection;
class PeMethodReference;
class PeMethodItem;
class TextField;

//---- MethodBrowser -----------------------------------------------------------

class PeMethodBrowser: public CollectionView {
	SeqCollection *allMethods, *filteredMethods;
	Class *ofClass;

public:
	MetaDef(PeMethodBrowser);
	PeMethodBrowser(EvtHandler *);
	~PeMethodBrowser();

	void DoSelect(Rectangle r, int clicks);
	void ShowMethodsOf(Class*);
	void SelectMethod(PeMethodReference *mr);
	PeMethodItem *GetSelectedMethod();
	void Filter();
	void RemoveFilter();
};

//---- Implementors ------------------------------------------------------------

class PeImplementors: public CollectionView {
	bool SameMethods(char *m1, char *m2);
	bool IsDestructor(char *m1);
public:
	MetaDef(PeImplementors);
	PeImplementors(EvtHandler *);
	void DoSelect(Rectangle r, int clicks);
	void ShowImplementorsOf(PeMethodReference *m, bool onlySubclasses);
	void ShowInherited(PeMethodReference *m);
};

//---- PeMethodFilterDialog ----------------------------------------------------

class PeMethodFilterDialog : public Dialog {
	TextField *pattern;
	bool hidePublic, hidePrivate, hideProtected;
	RegularExp *rex;
public:
	PeMethodFilterDialog();
	void Control(int id, int, void *v);
	VObject *DoMakeControls();
	VObject *DoMakeActions();
	SeqCollection *DoIt(Collection *allMethods);
};

//---- PeMethodItem ------------------------------------------------------------

class PeMethodItem: public TextItem {
public:
	Class *cl;
	PeMethodReference *mrp;

public:
	MetaDef(PeMethodItem);
	PeMethodItem(PeMethodReference *method, char *label);
	PeMethodItem(Class *cl);
	int Line();
	Class *GetClass();
	bool IsPublic();
};

#endif

